﻿using System.IO;

namespace Infrastructure
{
    public class TextLogger : Presentation.ILogger
    {
        private const string LOG_FILE = "log.txt";

        public TextLogger()
        {
            var streamReader = new StreamWriter(LOG_FILE);
            streamReader.Close();
        }
        public void Write(string s)
        {
            var streamWriter = new StreamWriter(LOG_FILE, true);
            streamWriter.WriteLine(s);
            streamWriter.Close();
        }
        public string Read()
        {
            var streamReader = new StreamReader(LOG_FILE);
            var result = streamReader.ReadToEnd();
            streamReader.Close();
            return result;
        }
    }
}
